import { useSelector } from "react-redux";
import { RootState } from "../store";

export function usePrimission(list: string[] = ['admin']) {
	const role = useSelector((state: RootState) => state.user.role);
	if (role === 'admin') return true
	return list.includes(role)
}